import { JSEncrypt } from 'encryptlong'

const PUBLIC_KEY_PWD =
  'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKmdI5AQ6nZCWaDXfOtWYfsbpI0pbvdOaJWXNHy3CqeBBJFDOyyVG0w3rXe5B2mPMhWXIVEkkbY2M66X87iXL+/ADMMsrnQ7hhuu0yO+UL9DEzWku5oJKhkHZ2zqVB/dTW/ZZcANLrhxN3OMLufzDuPKdq7Iq3Xal+Qc8nGS3KgwIDAQAB'
// 公钥加密(适用于登录密码加密)
export function encryptPwd(data: string) {
  const encryptor = new JSEncrypt()
  encryptor.setPublicKey(PUBLIC_KEY_PWD)
  // 普通的就是return encryptor.encrypt(data)
  return encryptor.encryptLong(data)
}
